#include <stdio.h>
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;

typedef struct 
{
    int from, to;
    double dis;
}typenod;
typedef struct 
{
    double x,y;
}typedian;
    
typenod   tt[105];
typedian  nod[105];
double map[102][102];
int n;
double ans;
    
    
double countdis(double xx1, double yy1, double xx2, double yy2)
{
    return sqrt((xx1-xx2)*(xx1-xx2)+(yy1-yy2)*(yy1-yy2));
}    

int main()
{
    int i, j, k, temp;
    
    cin >> n;
    for (i=1; i<=n; ++i)
    	cin >> nod[i].x >> nod[i].y;

   	for (i=1; i<=n; ++i)
   		for (j=i; j<=n; ++j)
   			map[i][j] = map[j][i] = countdis(nod[i].x, nod[i].y , nod[j].x, nod[j].y);

    /*/ check :
    for (i=1; i<=n; ++i, cout<<endl)
    	for (j=1; j<=n; ++j)
    		cout << map[i][j] << " ";
  	//cout<< endl;	*/
   	for (i=1; i<n; ++i)
   	{
   		tt[i].from = 1;
   		tt[i].to = i+1;
   		tt[i].dis = map[1][i+1];
    }  		
    double min;
    int pt;
    for (k=1; k<n; ++k)
    {
        min = tt[k].dis;
        pt = k;
        for (i=k+1; i<n; ++i)
        	if (tt[i].dis < min)
        	{
        	    min = tt[i].dis;
        	    pt = i;
        	}    
       	tt[0] = tt[k];
       	tt[k] = tt[pt];
       	tt[pt] = tt[0];
       	
       	j = tt[k].to;
        for (i=k+1; i<n; ++i)
        	if ( tt[i].dis > map[j][tt[i].to])
        	{
        	 	tt[i].dis = map[j][tt[i].to];
           		tt[i].from = j;   
        	}    
    }    
    ans=0;
    for (i=1;i<n; ++i)
    	ans += tt[i].dis;
   	printf("%.2lf\n", ans);
    
        
    
    return 0;
}    